/*
 * 
 *  This file is part of Sourceprojects.org Lycia Copyright 2010 noctarius
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 * 
 */
package org.sourceprojects.lycia;

import org.sourceprojects.lycia.internal.dom.ResourceResolverResult;
import org.w3c.dom.ls.LSInput;

/**
 * Interface for NamespaceResolver implementations to resolve namespaces to
 * other URLs than the default ones. Used in standard implementation to redirect
 * input to bundled XML schemata instead of using online version to be able to
 * work in offline state
 * 
 * @author noctarius
 * @since 0.0.1
 */
public interface NamespaceResolver {

	/**
	 * Returns the namespace URI
	 * 
	 * @return Namespace URI as String
	 */
	String getNamespaceURI();

	/**
	 * Returns an implementation of {@link LSInput} for the queried namespace
	 * 
	 * @param type
	 *            Type of the namespace to resolve
	 * @param namespaceURI
	 *            Original namespace URI to resolve
	 * @param publicId
	 *            PublicId of the namespace
	 * @param systemId
	 *            Local SystemId of the namespace
	 * @param baseURI
	 *            Base URI of the namespace
	 * @return The Implementation of {@link LSInput}
	 */
	ResourceResolverResult getInput(String type, String namespaceURI,
			String publicId, String systemId, String baseURI);
}
